EXIT

Section: MINTLIB LIBRARY FUNCTIONS (3)
Updated: 3 March 1993
Index Return to Main Contents
 

NAME

exit, _exit - terminate process  

SYNOPSIS

#include <stdlib.h>

void exit(int status);

#include <unistd.h>

void _exit(int status);
 

DESCRIPTION

exit terminates the calling process in the following way:

  - All registered exit handlers are called (see atexit).
  - Standard input, standard output, and standard error
    output are flushed.
  - All other open file descriptors are closed
  - _exit is called with the argument passed to exit. Returning from main() with a value is identical to calling exit with the same value. _exit terminates the calling process without cleanup action:

  - If profiling is active, profiling will be ended
    and the results will be written out to file. 
  - Pterm is called with the argument passed to _exit.  

SEE ALSO

atexit(3), Pterm(2), wait(3)  

NOTES

The argument to exit is returned as the return code to the calling program. Zero should be returned on success, non- zero should be returned on failure or abnormal termination. The Operating System does many things on process termination not mentioned above. For instance, memory is freed, the parent process is signalled, file locks are released and so on.
 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
NOTES

This document was created by man2html, using the manual pages.
Time: 11:15:17 GMT, June 22, 2025